<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Deletes files from the opcode cache</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.apc-delete-file" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">apc_delete_file</h1>
  <p class="verinfo">(PECL apc &gt;= 3.1.1)</p><p class="refpurpose"><span class="refname">apc_delete_file</span> &mdash; <span class="dc-title">Deletes files from the opcode cache</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.apc-delete-file-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>apc_delete_file</strong></span>
    ( <span class="methodparam"><span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span> <code class="parameter">$keys</code></span>
   ) : <span class="type"><a href="language.pseudo-types.html#language.types.mixed" class="type mixed">mixed</a></span></div>

  <p class="para rdfs-comment">
   Deletes the given files from the opcode cache.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.apc-delete-file-parameters">
  <h3 class="title">参数</h3>
  <dl>

   
    <dt>
<code class="parameter">keys</code></dt>

    <dd>

     <p class="para">
      The files to be deleted. Accepts a <span class="type"><a href="language.types.string.html" class="type string">string</a></span>,
      <span class="type"><a href="language.types.array.html" class="type array">array</a></span> of strings, or an <a href="class.apciterator.html" class="classname">APCIterator</a>
      <span class="type"><a href="language.types.object.html" class="type object">object</a></span>.
     </p>
    </dd>

   
  </dl>

 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.apc-delete-file-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <strong><code>TRUE</code></strong>， 或者在失败时返回 <strong><code>FALSE</code></strong>。
   Or if <code class="parameter">keys</code> is an <span class="type"><a href="language.types.array.html" class="type array">array</a></span>, then
   an empty array is returned on success, or an array of failed files
   is returned.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.apc-delete-file-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-404">
   <p><strong>Example #1 <span class="function"><strong>apc_delete_file()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$filename&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">'file.php'</span><span style="color: #007700">;<br /><br />if&nbsp;(</span><span style="color: #0000BB">apc_compile_file</span><span style="color: #007700">(</span><span style="color: #0000BB">$filename</span><span style="color: #007700">))&nbsp;{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">apc_delete_file</span><span style="color: #007700">(</span><span style="color: #0000BB">$filename</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Successfully&nbsp;deleted&nbsp;file&nbsp;</span><span style="color: #0000BB">$filename</span><span style="color: #DD0000">&nbsp;from&nbsp;APC&nbsp;cache."</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">PHP_EOL</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /><br />if&nbsp;(</span><span style="color: #0000BB">apc_compile_file</span><span style="color: #007700">(</span><span style="color: #0000BB">$filename</span><span style="color: #007700">))&nbsp;{<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">$good&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">apc_delete_file</span><span style="color: #007700">(array(</span><span style="color: #0000BB">$filename</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'donotexist.php'</span><span style="color: #007700">)))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$good</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /><br /></span><span style="color: #0000BB">$bad&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">apc_delete_file</span><span style="color: #007700">(</span><span style="color: #DD0000">'donotexist.php'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$bad</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
   </div>

   <div class="example-contents"><p>以上例程的输出类似于：</p></div>
   <div class="example-contents screen">
<div class="cdata"><pre>
Successfully deleted file file.php from APC cache.
[Mon May 24 09:30:33 2010] [apc-warning] Could not stat file donotexist.php, unable to delete from cache. in /tmp/test.php on line 13.
array(1) {
  [0]=&gt;
  string(14) &quot;donotexist.php&quot;
}
[Mon May 24 09:30:33 2010] [apc-warning] Could not stat file donotexist.php, unable to delete from cache. in /tmp/test.php on line 18.
bool(false)
</pre></div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.apc-delete-file-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="function"><a href="apc_clear_cache.html" class="function" rel="rdfs-seeAlso">apc_clear_cache()</a> - 清除APC缓存</span></li>
   <li class="member"><span class="function"><a href="apc_delete.html" class="function" rel="rdfs-seeAlso">apc_delete()</a> - 从用户缓存中删除某个变量</span></li>
   <li class="member"><span class="function"><a href="apc_exists.html" class="function" rel="rdfs-seeAlso">apc_exists()</a> - 检查APC中是否存在某个或者某些key</span></li>
  </ul>
 </div>

</div></div></div></body></html>